package com.piggy.logi.sys.api;

import com.piggy.common.core.constant.SecurityConstants;
import com.piggy.common.core.constant.ServiceNameConstants;
import com.piggy.common.core.domain.R;
import com.piggy.common.core.web.page.TableDataInfo;
import com.piggy.logi.sys.api.bo.LogiPricePlanExtEditBo;
import com.piggy.logi.sys.api.bo.LogiPricePlanQueryBo;
import com.piggy.logi.sys.api.bo.LogiSysMenuBo;
import com.piggy.logi.sys.api.factory.RemoteLogiMenuFallbackFactory;
import com.piggy.logi.sys.api.factory.RemoteLogiPricePlanFallbackFactory;
import com.piggy.logi.sys.api.vo.LogiPricePlanExtVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;

/**
 * 角色服务
 *
 * @author shark
 */
@FeignClient(contextId = "remoteLogiPricePlanService", value = ServiceNameConstants.SYSTEM_LOGI_SERVICE, fallbackFactory = RemoteLogiPricePlanFallbackFactory.class)
public interface RemoteLogiPricePlanService {

    /**
     * 查询价格方案管理列表
     */
    //@SaCheckPermission("sys:plan:list")
    @PostMapping("/logi/sys/plan/inner/list")
    TableDataInfo<LogiPricePlanExtVo> innerList(@Validated @RequestBody LogiPricePlanQueryBo bo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 查询价格方案管理列表
     */
    @PostMapping("/logi/sys/plan/inner/queryList")
    public R<List<LogiPricePlanExtVo>> queryInnerList(@Validated @RequestBody LogiPricePlanQueryBo bo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 获取价格方案管理详细信息
     */
    @GetMapping("/logi/sys/plan/inner/{id}")
    public R<LogiPricePlanExtVo> innerInfo(@NotNull(message = "主键不能为空")
                                           @PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 新增价格方案管理
     */
    @PostMapping("/logi/sys/plan/inner/add")
    public R<LogiPricePlanExtVo> innerAdd(@Validated @RequestBody LogiPricePlanExtEditBo bo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 修改价格方案管理
     */
    @PostMapping("/logi/sys/plan/inner/edit")
    public R<LogiPricePlanExtVo> innerEdit(@Validated @RequestBody LogiPricePlanExtEditBo bo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 删除价格方案管理
     */
    @PostMapping("/logi/sys/plan/inner/remove/{ids}")
    public R<Integer> innerRemove(@NotEmpty(message = "主键不能为空")
                                  @PathVariable(value = "ids") Long[] ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
